import React, { Component } from 'react';
import { getPersonalized } from '../../../api/discovery';
import Person from './person';
import './personalized.less';


export default class index extends Component {

  constructor() {
    super();

    this.state = {
      personalized: []
    }
  }

  // 生命周期函数
  componentDidMount() {
    // 调用函数拿到数据
    this.getPersonalizedData()
  }

  async getPersonalizedData() {
    const { data } = await getPersonalized();
    this.setState({
      personalized: data.result
    })
  }


  render() {
    return (
      <div className="personalized">
        <h3 className="title">推荐歌单</h3>
        <div className="items">
          {/* 模块化歌单列表 */}
          <Person personalized={this.state.personalized}/>
  


        </div>
      </div>
    )
  }
}
